package com.xjtu.chapter05.ex5_5;

/**
 * @author yjq
 * @version 1.0
 * @date 2021/8/17 11:57
 */
public class AnonymousInnerClassTest {
    public Paper pp(String s){
        //内部类定义开始
        return new Paper() {
            private String line;
            @Override
            public String mark() {
                line = s;
                return line;
            }
        };//分号必需，标记表达式的结束
    }

    public static void main(String[] args) {
        AnonymousInnerClassTest test = new AnonymousInnerClassTest();
        Paper c = test.pp("LOVE YOU");
        System.out.println(c.mark());
    }
}
